package com.ziyucoding.springboot.labs.lab10.seatdemo.tccscfeign.productservice.service;

/**
 * 商品 service接口
 *
 * @author ziyucoding
 * @date 2022-11-06
 **/
public interface ProductService {

    /**
     * 获取库存
     *
     * @param productId
     * @return void
     **/
    Integer getStock(Long productId) throws Exception;

    /**
     * 获取冻结库存
     *
     * @param productId
     * @return void
     **/
    Integer getFrozenStock(Long productId) throws Exception;

    /**
     * 冻结库存
     *
     * @param productId
     * @param amount
     * @return void
     **/
    void frozenStock(Long productId, Integer amount) throws Exception;

    /**
     * 释放冻结的库存
     *
     * @param productId
     * @param amount
     * @return void
     **/
    void cleanFrozenStock(Long productId, Integer amount) throws Exception;

    /**
     * 回滚冻结的库存
     *
     * @param productId
     * @param amount
     * @return void
     **/
    void rollbackFrozenStock(Long productId, Integer amount) throws Exception;
}
